<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <head>
        <th:block th:include="include :: header('表单校验')"/>
        <link rel="stylesheet" href="/xxl/adminlte/dist/css/AdminLTE-local.min.css">
        <link rel="stylesheet" href="/xxl/plugins/jsontree/jquery.jsonview.css">
    </head>
<body class="gray-bg">

<section class="content-header">
    <h1>更新接口</h1>
</section>

<section class="content">
    <form class="form-horizontal" id="ducomentForm">
        <input type="hidden" name="id" value="${document.id}">
        <input type="hidden" name="projectId" value="${document.projectId}">

        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">基础信息</h3>
                <div class="box-tools pull-right">
                    <button class="btn btn-default btn-xs" type="button"
                            onclick="javascript:window.location.href='${request.contextPath}/group?projectId=${projectId}'">
                        返回接口列表
                    </button>
                    <button class="btn btn-default btn-xs" type="button"
                            onclick="javascript:window.location.href='${request.contextPath}/document/detailPage?id=${document.id}'">
                        接口详情页
                    </button>
                    <button class="btn btn-info btn-xs" type="submit">更新接口</button>
                </div>
            </div>

            <div class="box-body">
                <div class="form-group">
                    <label class="col-sm-1 control-label">URL</label>
                    <div class="col-sm-6">
                        <input type="text" class="form-control" name="requestUrl" value="${document.requestUrl}"
                               placeholder="请输入接口URL（相对地址）" maxlength="100">
                    </div>
                    <label class="col-sm-1 control-label">分组</label>
                    <div class="col-sm-4">
                        <select class="form-control select2" style="width: 100%;" name="groupId">

                        </select>
                    </div>

                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">Method</label>
                    <div class="col-sm-6">
                        <select class="form-control select2" style="width: 100%;" name="requestMethod">

                        </select>
                    </div>
                    <label class="col-sm-1 control-label">状态</label>
                    <div class="col-sm-4">
                        <input type="radio" class="iCheck" name="status" value="0"/>启用 &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="status" value="1"/>维护 &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="status" value="2"/>废弃
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">名称</label>
                    <div class="col-sm-11">
                        <input type="text" class="form-control" name="name" value="${document.name}"
                               placeholder="请输入接口名称"
                               maxlength="50">
                    </div>
                </div>
            </div>
        </div>

        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">请求头部</h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" id="requestHeaders_add"><i
                            class="fa fa-plus"></i></button>
                </div>
            </div>

            <div id="requestHeaders_example" style="display: none;">
                <div class="form-group requestHeaders_item">
                    <label class="col-sm-1 control-label">Key</label>
                    <div class="col-sm-4 item">
                        <select class="form-control select2_tag_new key">
                        </select>
                    </div>
                    <label class="col-sm-1 control-label">Value</label>
                    <div class="col-sm-5 item">
                        <input type="text" class="form-control value">
                    </div>
                    <button type="button" class="col-sm-1 btn btn-box-tool delete"><i
                            class="fa fa-fw fa-close"></i></button>
                </div>
            </div>

            <div class="box-body" id="requestHeaders_parent">

            </div>

        </div>

        <div class="box box-primary">
            <div class="box-header with-border">
                <h3 class="box-title">请求参数</h3>
                <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" id="queryParams_add"><i
                            class="fa fa-plus"></i></button>
                </div>
            </div>

            <div id="queryParams_example" style="display: none;">
                <div class="form-group queryParams_item">
                    <label class="col-sm-1 control-label">参数</label>
                    <div class="col-sm-2 item">
                        <input type="text" class="form-control name">
                    </div>
                    <label class="col-sm-1 control-label">说明</label>
                    <div class="col-sm-2 item">
                        <input type="text" class="form-control desc">
                    </div>
                    <label class="col-sm-1 control-label">类型</label>
                    <div class="col-sm-2 item">
                        <select class="form-control select2_tag_new type" style="width: 100%;">

                        </select>
                    </div>
                    <div class="col-sm-2 item">
                        <select class="form-control select2_tag_new notNull" style="width: 100%;">
                            <option value="true">必填</option>
                            <option value="false">非必填</option>
                        </select>
                    </div>

                    <button type="button" class="col-sm-1 btn btn-box-tool delete"><i
                            class="fa fa-fw fa-close"></i></button>
                </div>
            </div>

            <div class="box-body" id="queryParams_parent">
                <!--                        <#if queryParamList?exists>-->
                <!--                        <#list queryParamList as queryParam>-->
                <div class="form-group queryParams_item">
                    <label class="col-sm-1 control-label">参数</label>
                    <div class="col-sm-2 item">
                        <input type="text" class="form-control name" value="${queryParam.name}">
                    </div>
                    <label class="col-sm-1 control-label">说明</label>
                    <div class="col-sm-2 item">
                        <input type="text" class="form-control desc" value="${queryParam.desc}">
                    </div>
                    <label class="col-sm-1 control-label">类型</label>
                    <div class="col-sm-2 item">
                        <select class="form-control select2_tag type" style="width: 100%;">

                        </select>
                    </div>
                    <div class="col-sm-2 item">
                        <select class="form-control select2_tag notNull" style="width: 100%;">

                        </select>
                    </div>

                    <button type="button" class="col-sm-1 btn btn-box-tool delete"><i
                            class="fa fa-fw fa-close"></i>
                    </button>
                </div>
            </div>
        </div>

        <div class="nav-tabs-custom">
            <!-- Tabs within a box -->
            <ul class="nav nav-tabs pull-right">
                <li><a href="#fail_resp" data-toggle="tab">失败响应结果</a></li>
                <li class="active"><a href="#success_resp" data-toggle="tab">成功响应结果</a></li>
                <li class="pull-left header">响应结果</li>
            </ul>
            <div class="tab-content no-padding">
                <!-- Morris chart - Sales -->
                <div class="chart tab-pane active" id="success_resp" style="position: relative; height: 365px;">
                    <div class="box-body">
                        响应数据类型(MIME)：
                        <input type="radio" class="iCheck" name="successRespType" value="JSON" checked>JSON
                        &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="successRespType" value="XML">XML &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="successRespType" value="HTML">HTML &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="successRespType" value="TEXT">TEXT &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="successRespType" value="JSONP">JSONP &nbsp;&nbsp;
                        <button type="button" class="btn btn-box-tool pull-right" id="successRespExample_2json">
                            JSON格式化
                        </button>
                        <br>
                        <textarea name="successRespExample" id="successRespExample"
                                  style="width: 100%; height: 300px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;margin-top: 15px;"></textarea>
                    </div>
                </div>
                <div class="chart tab-pane" id="fail_resp" style="position: relative; height: 365px;">
                    <div class="box-body">
                        响应数据类型(MIME)：
                        <input type="radio" class="iCheck" name="failRespType" value="JSON" checked>JSON &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="failRespType" value="XML">XML &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="failRespType" value="HTML">HTML &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="failRespType" value="TEXT">TEXT &nbsp;&nbsp;
                        <input type="radio" class="iCheck" name="failRespType" value="JSONP">JSONP &nbsp;&nbsp;
                        <button type="button" class="btn btn-box-tool pull-right" id="failRespExample_2json">
                            JSON格式化
                        </button>
                        <br>
                        <textarea name="failRespExample" id="failRespExample"
                                  style="width: 100%; height: 300px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;margin-top: 15px;"></textarea>
                    </div>
                </div>
            </div>
        </div>


    </form>

</section>


<th:block th:include="include :: footer"/>
</body>
</html>
